<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let arr = [1, 2, 3];
        let [a, b, c] = arr;
        console.log(a);
        console.log(b);
        console.log(c);

        let person = {
            name: 'xuy',
            age: 18
        }
        let {
            name,
            age
        } = person;
        console.log(name);
        console.log(age);
        let {
            name: newvar //冒号左边是对象匹配的属性  把属性值赋值给右边的变量
        } = person;
        console.log(newvar);
    </script>
</body>

</html>